package name.jiaosha.air.iostorage.domain;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.ali8ba.Domain;

@Entity
@Table(name = "buy_item")
public class BuyItem extends Domain {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2514784239057284785L;

	@Id()
	@Column(name = "id", unique = true, nullable = false, precision = 11)
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	/**
	 * 主表单据号
	 */
	@Column(name = "docID")
	private String docID;

	@Column(name = "goodsId")
	private Integer goodsId;
	/**
	 * 商品编码
	 */
	@Column(name = "productCode")
	private String productCode;
	/**
	 * 商品名称
	 */
	@Column(name = "name")
	private String name;
	/**
	 * 单位
	 */
	@Column(name = "unit")
	private String unit;
	/**
	 * 数量　
	 */
	@Column(name = "amount")
	private BigDecimal amount;
	/**
	 * 单价（成本价）
	 */
	@Column(name = "unitPrice")
	private BigDecimal unitPrice;
	/**
	 * 仓库id
	 */
	@Column(name = "storageId")
	private Integer storageId;

	/**
	 * 剩余量(未被使用的量)
	 */
	@Column(name = "surplus")
	private BigDecimal surplus;

	@Transient
	private String storageName;

	public BuyItem() {

	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getDocID() {
		return docID;
	}

	public void setDocID(String docID) {
		this.docID = docID;
	}

	public String getProductCode() {
		return productCode;
	}

	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public BigDecimal getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}

	public Integer getStorageId() {
		return storageId;
	}

	public void setStorageId(Integer storageId) {
		this.storageId = storageId;
	}

	public BigDecimal getSurplus() {
		return surplus;
	}

	public void setSurplus(BigDecimal surplus) {
		this.surplus = surplus;
	}

	public Integer getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(Integer goodsId) {
		this.goodsId = goodsId;
	}

	@Transient
	public String getStorageName() {
		return storageName;
	}

	public void setStorageName(String storageName) {
		this.storageName = storageName;
	}

}
